#define _USE_MATH_DEFINES
#include <cstdlib>
#include <cstring>
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

typedef struct TPoint {
	double x, y;
} TPoint;

typedef struct TTri {
	TPoint points[4];
} TTri;

typedef struct TLine {
	int len;
	TPoint *points;
} TLine;
TLine lines[3];

TPoint boundary[110];
double leftMost, rightMost;

TPoint operator-(TPoint a, TPoint b) {
	TPoint res;
	res.x = a.x - b.x;
	res.y = a.y - b.y;
	return res;
}

const double eps = 0.000000001;

bool eq(double a, double b) {return fabs(a-b)<eps;}

bool isEnd(TTri x) {
	for (int i=0; i<3; ++i) {
		if (fabs(x.points[i].x) > eps) 
			return false;
		if (fabs(x.points[i].y) > eps) 
			return false;
	}
	return true;
}

double cross(TPoint a, TPoint b) {
	return a.x*b.y - a.y*b.x;
}

double dot(TPoint a, TPoint b) {
	return a.x*b.x + a.y*b.y;
}

double norm(TPoint p) {return p.x*p.x + p.y*p.y;}

double calAngel(TPoint d, TPoint a, TPoint b) {
	TPoint u, v;
	u = a-d;
	v = b-d;
	double deg = asin(cross(u, v) / sqrt(norm(u)*norm(v)));
	if (norm(b-a) > norm(u) + norm(v)) {
		if (deg < 0)
			deg = -M_PI - deg;
		else
			deg = M_PI - deg;
	}
	return deg;
}

bool isOnLine(TPoint d, TPoint a, TPoint b) {
	return eq(cross(a-d, b-d), 0);
}
bool isInLine(TPoint d, TPoint a, TPoint b) {
	return dot(a-d, b-d) < eps;
}

bool inTri(TPoint d, TTri tri) {
	for (int i=0; i<3; ++i)
		if (isOnLine(d, tri.points[i], tri.points[i+1])) {
			if (isInLine(d, tri.points[i], tri.points[i+1]))
				return true;
		}

	double ang[3];
	double tot = 0;
	for (int i=0; i<3; ++i) {
		ang[i] = calAngel(d, tri.points[i], tri.points[i+1]);
		tot += ang[i];
	}

	return (fabs(tot) >= 1);//-PI, 0(out), PI
}

void calLine(TPoint a, TPoint b, TLine& line) {
	int l, u;

	if (a.x > b.x) swap(a, b);

	if (eq(a.x, b.x)) {
		if (eq(a.x, int(a.x))) {
			line.len = 2;
			line.points = new TPoint[2];
			line.points[0] = a;
			line.points[1] = b;
		}
		else {
			line.len = 0;
			line.points = 0;
		}
	}
	else {
		l = int(ceil(a.x-eps));
		u = int(b.x+eps);
		line.len = u-l+1;
		line.points = new TPoint[line.len];
		for (int i=l; i<=u; ++i) {
			line.points[i-l].x = i;
			line.points[i-l].y = a.y + (i - a.x) * (b.y - a.y) / (b.x - a.x) ;
		}
	}
}

int calInTri(TTri t) {
	leftMost = 10000;
	rightMost = -10000;
	for (int i=0; i<100; ++i) {
		boundary[i].x = 10000;
		boundary[i].y = -10000;
	}
	for (int i=0; i<3; ++i) {
		calLine(t.points[i], t.points[i+1], lines[i]);
		if (lines[i].len > 0) {
			double t;
			t = lines[i].points[0].x;
			if (t < leftMost) {
				leftMost = t;
			}
			t = lines[i].points[lines[i].len-1].x;
			if (t > rightMost) {
				rightMost = t;
			}
			for (int j = 0; j < lines[i].len; ++j) {
				TPoint p = lines[i].points[j];
				boundary[int(p.x)].x = min(boundary[int(p.x)].x, p.y);
				boundary[int(p.x)].y = max(boundary[int(p.x)].y, p.y);
			}
		}
	}

	int tot = 0;
	for (int i = max(1, int(leftMost)); i <= min(99, int(rightMost)); ++i) {
// 		cout << "x=" << i << ", " << boundary[i].x << " " << boundary[i].y << endl;
// 		cout << floor(boundary[i].y) << " " << ceil(boundary[i].x) << " "
// 			<< int(floor(boundary[i].y) - ceil(boundary[i].x)+0.5) << endl;
		tot += int(min(99, int(boundary[i].y+eps)) - max(1.0, ceil(boundary[i].x-eps)))+1;
	}
	return tot;
}

int main(void)
{
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// 	cout << 1 << " " << ceil(1.0) << " " << ceil(1+eps) << endl;
	for (int i=0; i<3; ++i) {
		lines[i].len = 0;
		lines[i].points = 0;
	}
	while (true) {
		TTri tri;
		for (int i=0; i<3; ++i)
			cin >> tri.points[i].x >> tri.points[i].y;
		tri.points[3] = tri.points[0];
		if (isEnd(tri)) break;

		cout <<setw(4) << right << calInTri(tri) << endl;
		for (int i=0; i<3; ++i) {
			if (lines[i].len > 0) {
				lines[i].len = 0;
				delete[] lines[i].points;
				lines[i].points = 0;
			}
		}
	}
		
//	if (count.size()>0) cout <<setw(4) << right << count[count.size()-1];
// 	fclose(stdout);
	return 0;
}
